package com.wcgksoft.entity.Alert;

import com.wcgksoft.entity.dataAnalysis.DepartProjectData;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * @author 御风
 * @version V1.0
 * @Package com.wcgksoft.entity.Alert
 * @Description TODO 告警流水记录表
 * @date 2020/6/4 17:21
 * @ClassName AlarmHistory
 */
@Entity
@Table(name = "t_alarmHistory")
public class AlarmHistory {

    @Id
    @Basic(optional = false)
    @GeneratedValue(generator = "system_uuid")
    @GenericGenerator(name = "system_uuid", strategy = "uuid")
    @Column(name = "id", nullable = false, length = 32)
    private String id;

    /*
     *告警级别
     */
    @Column(name = "level")
    private String level;

    /*
     *告警类型码
     */
    @Column(name = "typecode")
    private String typecode;


    /**
     * 数据点
     */
    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "depart_project_data")
    @Cascade({org.hibernate.annotations.CascadeType.REFRESH})
    private DepartProjectData departProjectData;

    /*
     *通道
     */
    @Column(name = "com")
    private String com;

    /*
     *企业id
     */
    @Column(name = "enterpriseid")
    private Integer enterpriseid;

    /*
     *设备
     */
    @Column(name = "no")
    private String no;
    /*
     * 设定值
     */
    @Column(name = "setvalue")
    private Double setvalue;

    /*
     * 告警数据名称
     */
    @Column(name = "arname")
    private String arname;

    /*
     * 当前值
     */
    @Column(name = "currentvalue")
    private Double currentvalue;

    /*
     * 首次告警时间
     */

    @Column(name = "onealarmtime")
    private Date onealarmtime;



    /*
     * 告警时间
     */

    @Column(name = "alarmtime")
    private Date alarmtime;



    /*
     * 告警状态  1为解决  0 已解决
     */
    @Column(name = "stitas")
    private Integer stitas;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Double getSetvalue() {
        return setvalue;
    }

    public void setSetvalue(Double setvalue) {
        this.setvalue = setvalue;
    }

    public Double getCurrentvalue() {
        return currentvalue;
    }

    public void setCurrentvalue(Double currentvalue) {
        this.currentvalue = currentvalue;
    }

    public Date getAlarmtime() {
        return alarmtime;
    }

    public void setAlarmtime(Date alarmtime) {
        this.alarmtime = alarmtime;
    }

    public String getArname() {
        return arname;
    }

    public void setArname(String arname) {
        this.arname = arname;
    }


    public Integer getStitas() {
        return stitas;
    }

    public void setStitas(Integer stitas) {
        this.stitas = stitas;
    }

    public String getTypecode() {
        return typecode;
    }

    public void setTypecode(String typecode) {
        this.typecode = typecode;
    }

    public String getCom() {
        return com;
    }

    public void setCom(String com) {
        this.com = com;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public DepartProjectData getDepartProjectData() {
        return departProjectData;
    }

    public void setDepartProjectData(DepartProjectData departProjectData) {
        this.departProjectData = departProjectData;
    }

    public Integer getEnterpriseid() {
        return enterpriseid;
    }

    public void setEnterpriseid(Integer enterpriseid) {
        this.enterpriseid = enterpriseid;
    }

    public Date getOnealarmtime() {
        return onealarmtime;
    }

    public void setOnealarmtime(Date onealarmtime) {
        this.onealarmtime = onealarmtime;
    }
}
